<%@page contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>学生信息系统主界面</title>
        <meta http-equiv="content-type"
        content="text/html" charset="UTF-8"/>
        
        <%
            if(session.getAttribute("currUser")==null){
             response.sendRedirect("index.jsp");
             return;
            }
        %>
        
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.3/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.3/themes/icon.css">
    <script type="text/javascript" src="jquery-easyui-1.3.3/jquery.min.js"></script>
    <script type="text/javascript" src="jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
    	$(function(){
    		var treeData=[{
    			text:"根",
    			children:[{
    				text:"班级信息管理",
    				attributes:{
    					url:"gradeInfoManage.jsp"
    				}
    			},{
    				text:"学生信息管理",
    				attributes:{
    					url:"studentInfoManage.jsp"
    				}
    			}]
    		}];
    		//实例化菜单
    		$("#tree").tree({
    			data:treeData,
    			lines:true,
    			onClick:function(node){
    				if(node.attributes){
    					openTab(node.text,node.attributes.url);
    				}
    			}
    		});
    		//新增Tab
    		function openTab(text,url){
    			if($("#tabs").tabs('exists',text)){
    				$("#tabs").tabs("select",text);
    			}else{
    				var content="<iframe frameborder='0' scrolling='auto' style='width:100%;height:100%' src="+url+"></iframe>";
    				$("#tabs").tabs('add',{
        				title:text,
        				closable:true,
        				content:content
        			});
    			}
    		}
    	});
    </script>
    </head>
    <body class="easyui-layout">
    	<div region="north" style="height:80px; background-color:#E0EDFF">
            <div align="left" style="width:80%;float:left"><img src="images/main.jpg"></div>
            <div style="padding-top: 50px;padding-right: 20px;">当前用户：&nbsp;<font color="red" >${currUser.userName }</font></div>
        </div>
    	<div region="center">
            <div class="easyui-tabs" fit="true" border="false" id="tabs">
                <div title="首页">
                    <div align="center" style="padding-top:265px;"><font color="red" style="font-size: 40px;">欢迎使用</font></div>
                </div>            
            </div>
        </div>
    	<div region="west" style="width:150px;" title="导航菜单" split="true">
            <ul id="tree"></ul>
        </div>
    	<div region="south" style="height:25px;" align="center">版权所有<a href="http://git.oschina.net/liddhome" target="blank">git.oschina.net</a></div>
    </body>
</html>